<template>
  <div class="pub">
    <!-- -->
    信息内容：{{mes}}

    <Sub/>
  </div>
</template>

<script>
import pubsub from "pubsub-js"
import Sub from '@/components/Sub.vue';
export default {
  name: 'Pub',
  data() {
    return {
      mes:""
    };
  },
 components:{Sub},
  mounted() {
    pubsub.subscribe("reciveMes",this.backFun)
  },

  methods: {
    backFun(mesName,data){
        this.mes=data
    }
  },
};
</script>
<style scoped>
.pub{
    width: 100px;
    height: 100px;
    background-color: aquamarine;
}
</style>